package com.syj.jsxjj.ui.lend.adapter;

import android.graphics.Color;
import android.graphics.Typeface;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.syj.jsxjj.R;
import com.syj.jsxjj.ui.lend.bean.RadioVo;
import com.syj.jsxjj.widget.recycler.BaseRecyclerAdapter;

import butterknife.BindView;
import butterknife.ButterKnife;


/**
 * Created by liusong on 2017/5/31.
 */

public class LoanFilterListAdapter extends BaseRecyclerAdapter<LoanFilterListAdapter.ViewHolder, RadioVo> {
    @Override
    public LoanFilterListAdapter.ViewHolder mOnCreateViewHolder(ViewGroup parent, int viewType) {
        return new LoanFilterListAdapter.ViewHolder(mInflater.inflate(R.layout.item_rv_loan_filter, parent, false));
    }

    @Override
    public void mOnBindViewHolder(ViewHolder holder, int position) {
        holder.mText.setText(item.getContent());
        if (item.isFlag()) {
            holder.mText.setTextColor(Color.parseColor("#2f7cff"));
            holder.mText.setTypeface(Typeface.DEFAULT_BOLD);
        } else {
            holder.mText.setTextColor(Color.parseColor("#646a75"));
            holder.mText.setTypeface(Typeface.DEFAULT);
        }
    }

    static class ViewHolder extends RecyclerView.ViewHolder{
        @BindView(R.id.tv_text)
        TextView mText;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
